//package com.cbwl.eoas.cms.web.controller.security;
//
//import java.io.IOException;
//
//import javax.servlet.Filter;
//import javax.servlet.FilterChain;
//import javax.servlet.FilterConfig;
//import javax.servlet.ServletException;
//import javax.servlet.ServletRequest;
//import javax.servlet.ServletResponse;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
///**
// * 过滤器
// * @author Mbenben
// *
// */
//
//public class XssFilter implements Filter {
//
//	FilterConfig filterConfig = null;
//	//初始化
//	public void init(FilterConfig filterConfig) throws ServletException {
//		this.filterConfig = filterConfig;
//	}
//	//销毁
//	public void destroy() {
//		this.filterConfig = null;
//	}
//	//执行阶段
//	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
//			throws IOException, ServletException {
//		HttpServletRequest req = ((HttpServletRequest) request);
//		if (req.getRequestURI().equals("/")
//				|| req.getRequestURI().indexOf("login") != -1
//				|| req.getRequestURI().indexOf("error/403") != -1
//				|| req.getRequestURI().indexOf("/v1/user/checkUserNameOrPwd") != -1
//				|| req.getRequestURI().indexOf("/assets/plugins") != -1
//				|| req.getRequestURI().indexOf("/assets/css") != -1
//				|| req.getRequestURI().indexOf("/assets/scripts") != -1
//				|| req.getRequestURI().indexOf("/v1/") != -1
//				|| req.getRequestURI().indexOf("jquery") != -1
//				|| req.getRequestURI().indexOf("common/common.jsp") != -1
//				|| req.getRequestURI().indexOf("assets/images") != -1
//				)
//		{
//
//		} else {
//			Object obj = req.getSession().getAttribute("user");
//			if (obj == null) {
//				((HttpServletResponse) response).sendRedirect("/main/login");
//				return;
//			}
//		}
//		chain.doFilter(new XssHttpServletRequestWrapper((HttpServletRequest) request), response);
//	}
//}
